﻿/**********************************************************************************
 * Project Name :   
 * Remarks      :  
 * Class Name   :  BaseModel 
 * Version      :  v1.0.0.0 
 * Author       :  Joey Liang 
 * Description  : 
 * Created Time :  2013/8/14 22:38:59
 * Update Man   :  Joey Liang
 * Update Time  :  2013/8/14 22:38:59
************************************************************************/

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace JoeyLibs.IdleStartMenu.Model
{
    /// <summary>
    /// 进程模型
    /// </summary>
    public class BaseModel
    {
        private int id;
        /// <summary>
        /// 编号
        /// </summary>
        public virtual int ID
        {
            get { return id; }
            set { id = value; }
        }

        private ModelHandleState handleState;
        /// <summary>
        /// 模型操作状态
        /// </summary>
        public virtual ModelHandleState HandleState
        {
            get { return handleState; }
            set { handleState = value; }
        }

        public override bool Equals(object obj)
        {
            if (obj is BaseModel)
            {
                BaseModel model = obj as BaseModel;
                return model.ID == this.ID && obj.GetType().Equals(this.GetType());
            }

            return false;
        }

        public override int GetHashCode()
        {
            return this.id.GetHashCode();
        }
    }
}
